# !/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: JHC000abc@gmail.com
@file: mitmdump_script.py
@time: 2025/3/17 11:11 
@desc: 

"""
import os
from mitmproxy import http


def send_cookies(cookies):
    """

    """
    print("cookies=", cookies)
    os.system("taskkill /F /IM iFin*")
    os.system("taskkill /F /IM mitm*")


def request(flow: http.HTTPFlow) -> None:
    if "standardgwapi/api/news_service" in flow.request.pretty_url:
        jgbsessid = flow.request.cookies.get('jgbsessid')
        # 发送 jgbsessid
        send_cookies(jgbsessid)

